<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../../js/vue.js"></script>
    <style>
        [v-cloak] {
            display: none;
        }
    </style>
</head>

<body>

    <dvi id="app">
        <form>
            <!-- input==文本 -->
            <div>
                <span>姓名：</span>
                <span>
                    <input type="text" v-model="uname">
                </span>
            </div>
            <!-- input==单选 -->
            <div>
                <span>性别：</span>
                <span>
                    <input type="radio" id="male" value="1" v-model="gender">
                    <label for="male"> 男</label>
                    <input type="radio" id="female" value="2" v-model="gender">
                    <label for="female"> 女</label>
                </span>
            </div>
            <!-- input==多选 -->
            <div>
                <span>爱好：</span>
                <input type="checkbox" id="ball" value="1" v-model="hobby">
                <label for="ball"> 篮球</label>
                <input type="checkbox" id="sing" value="2" v-model="hobby">
                <label for="sing"> 唱歌</label>
                <input type="checkbox" id="view" value="3" v-model="hobby">
                <label for="view"> 看电影</label>
            </div>
            <!-- 下拉框 -->
            <div>
                <span>职业：</span>单选
                <select v-model="occupation">
                    <option value="0">选择你喜欢的职业吧</option>
                    <option value="1">学生</option>
                    <option value="2">职工</option>
                    <option value="3">老师</option>
                    <option value="4">领导</option>
                    <option value="5">校长</option>
                </select>多选
                <select v-model="occupation2" multiple>
                    <option value="0">选择你喜欢的职业吧</option>
                    <option value="1">学生</option>
                    <option value="2">职工</option>
                    <option value="3">老师</option>
                    <option value="4">领导</option>
                    <option value="5">校长</option>
                </select>
            </div>
            <!-- 多行文本 -->
            <div>
                <span>个人简介</span>
                <textarea v-model="textarea"></textarea>
            </div>

            <div><input type="submit" @click.prevent="change"></div>
        </form>
    </dvi>

    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                uname: "list",
                gender: "1",
                hobby: [1, "2"],
                occupation: "2",
                // occupation:["2"],
                occupation2: [1, 3],
                textarea: ""
            },
            methods: {
                change() {
                    console.log(this.uname)
                    console.log(this.gender)
                    console.log(this.hobby)
                    console.log(this.occupation)
                    console.log(this.occupation2)
                    console.log(this.textarea)
                }
            }
        })
    </script>
</body>

</html>